package com.bilin.coin.tools;

import com.bilin.coin.utils.xml.XML;

import org.json.JSONException;
import org.json.JSONObject;

public class Test {

    public static void main(String[] args) {
        String resp="<?xml version=\"1.0\" encoding=\"utf-8\"?><request><filelist><treenode><!--code 0表示成功--><code>0</code></treenode></filelist></request>";
        try {
            JSONObject jsonObj = XML.toJSONObject(resp);
            JSONObject jsonRequest = jsonObj.getJSONObject("request");
            JSONObject jsonfilelist=jsonRequest.getJSONObject("filelist");
            JSONObject jsontreenode=jsonfilelist.getJSONObject("treenode");
            int jsoncode=jsontreenode.getInt("code");
            System.err.println(jsoncode);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
